<script>
init({
  title: 'Thead Classes',
  desc: 'Use `theadClasses` option to set the table header styles.',
  links: ['bootstrap-table.min.css'],
  scripts: ['bootstrap-table.min.js']
})
</script>

<script>
  const $table = $('#table')

  function mounted () {
    $table.bootstrapTable({
      columns: [
        {
          title: 'ID',
          field: 'id'
        },
        {
          title: 'Item Name',
          field: 'name'
        },
        {
          title: 'Item Price',
          field: 'price'
        }
      ]
    })

    $('.toolbar input').change(function () {
      const classes = $('.toolbar input:checked').next().text()

      $table.bootstrapTable('refreshOptions', {
        theadClasses: classes
      })
    })
  }
</script>

<template>
  <div class="toolbar">
    <div class="radio">
      <label>
        <input
          type="radio"
          checked
          name="theadClasses"
        >
        <code>undefined</code>
      </label>
    </div>
    <div class="radio">
      <label>
        <input
          type="radio"
          name="theadClasses"
        >
        <code>table-light</code>
      </label>
    </div>
  </div>

  <div class="radio">
    <label>
      <input
        type="radio"
        name="theadClasses"
      >
      <code>table-dark</code>
    </label>
  </div>

  <table
    id="table"
    data-url="json/data1.json"
  ></table>
</template>

<style>
  .radio {
    float: left;
    margin-right: 15px;
  }
</style>
